<template>
    <ul class="mail-list">
      <MailItem
        v-for="mail in mails"
        :key="mail.id"
        :mail="mail"
        @click="openMail(mail.id)"
      />
    </ul>
  </template>
  <script>
  import MailItem from './MailItem.vue';
  export default {
    props: { mails: Array },
    components: { MailItem },
    methods: { openMail(id) { this.$router.push(`/email/${id}`); } }
  };
  </script>